package com.gqj.elec.service.impl;

import java.util.List;
import com.gqj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gqj.elec.mapper.ElecMaterialCheckMapper;
import com.gqj.elec.domain.ElecMaterialCheck;
import com.gqj.elec.service.IElecMaterialCheckService;

/**
 * 资产盘点主Service业务层处理
 * 
 * @author lxq
 * @date 2023-12-17
 */
@Service
public class ElecMaterialCheckServiceImpl implements IElecMaterialCheckService 
{
    @Autowired
    private ElecMaterialCheckMapper elecMaterialCheckMapper;

    /**
     * 查询资产盘点主
     * 
     * @param checkId 资产盘点主主键
     * @return 资产盘点主
     */
    @Override
    public ElecMaterialCheck selectElecMaterialCheckByCheckId(Long checkId)
    {
        return elecMaterialCheckMapper.selectElecMaterialCheckByCheckId(checkId);
    }

    /**
     * 查询资产盘点主列表
     * 
     * @param elecMaterialCheck 资产盘点主
     * @return 资产盘点主
     */
    @Override
    public List<ElecMaterialCheck> selectElecMaterialCheckList(ElecMaterialCheck elecMaterialCheck)
    {
        return elecMaterialCheckMapper.selectElecMaterialCheckList(elecMaterialCheck);
    }

    /**
     * 新增资产盘点主
     * 
     * @param elecMaterialCheck 资产盘点主
     * @return 结果
     */
    @Override
    public int insertElecMaterialCheck(ElecMaterialCheck elecMaterialCheck)
    {
        elecMaterialCheck.setCreateTime(DateUtils.getNowDate());
        return elecMaterialCheckMapper.insertElecMaterialCheck(elecMaterialCheck);
    }

    /**
     * 修改资产盘点主
     * 
     * @param elecMaterialCheck 资产盘点主
     * @return 结果
     */
    @Override
    public int updateElecMaterialCheck(ElecMaterialCheck elecMaterialCheck)
    {
        elecMaterialCheck.setUpdateTime(DateUtils.getNowDate());
        return elecMaterialCheckMapper.updateElecMaterialCheck(elecMaterialCheck);
    }

    /**
     * 批量删除资产盘点主
     * 
     * @param checkIds 需要删除的资产盘点主主键
     * @return 结果
     */
    @Override
    public int deleteElecMaterialCheckByCheckIds(Long[] checkIds)
    {
        return elecMaterialCheckMapper.deleteElecMaterialCheckByCheckIds(checkIds);
    }

    /**
     * 删除资产盘点主信息
     * 
     * @param checkId 资产盘点主主键
     * @return 结果
     */
    @Override
    public int deleteElecMaterialCheckByCheckId(Long checkId)
    {
        return elecMaterialCheckMapper.deleteElecMaterialCheckByCheckId(checkId);
    }
}
